﻿// Created by amoylel on 12/18/2018.
// Copyright (c) 2018 amoylel All rights reserved.

#ifndef AMO_LEXICAL_CAST_09051179_E0D4_48D7_A0FF_B063C060A4DD_HPP__
#define AMO_LEXICAL_CAST_09051179_E0D4_48D7_A0FF_B063C060A4DD_HPP__




#include <boost/lexical_cast.hpp>


namespace amo {
    template <typename Target, typename Source>
    inline Target lexical_cast(const Source &arg) {
        try {
            return boost::lexical_cast<Target>(arg);
        } catch (boost::bad_lexical_cast&) {
            return Target();
            //return  boost::value_initialized<Target> ();
        }
        
    }
}


#endif // AMO_LEXICAL_CAST_09051179_E0D4_48D7_A0FF_B063C060A4DD_HPP__
